package com.study.talk.module.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.study.talk.module.entity.Friend;
import com.study.talk.module.entity.InviteGroupRecord;
import com.study.talk.module.entity.InviteUserRecord;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author thor
 * @since 2023-12-18
 */
@Mapper
public interface InviteGroupRecordMapper extends BaseMapper<InviteGroupRecord> {

    @Delete("delete from invite_group_record where user_id=#{userId} and invite_id=#{inviteId} and group_id=#{groupId}")
    void removeGroupUserInfo(Integer groupId, Integer inviteId ,Integer userId);

    @Select("select * from invite_group_record where  user_id=#{userId} and invite_id=#{inviteId} and group_id=#{groupId}")
    InviteGroupRecord queryHasMember(Integer groupId,  Integer inviteId ,Integer userId);

}

